package quizman.domain;
public class Choice {
	private String text;
	private boolean isCorrect;

	public Choice(String text)
	{
		this.text = text;
		isCorrect = false;		
	}
	
	public Choice(String text, boolean isCorrect)
	{
		this.text = text;
		this.isCorrect = isCorrect;		
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getText() {
		return text;
	}
	public String getFormHtml(String question, int choiceNumber)
	{
		String id = question+"-"+choiceNumber;
		return "<input type=\"radio\" id=\""+id+"\" name=\"" + question + "\" value=\"" 
		+ choiceNumber + "\"> " 
		+"<label for=\""+id+"\">"+ choiceNumber + ") "
		+getText() + "<label><br>\n";
	}

	/**
	 * @return the isCorrect
	 */
	public boolean isCorrect() {
		return isCorrect;
	}
	
}
